<script setup lang="ts">
// import { ref } from "vue";
import { useSerial } from "./hook";

const {
  serialLogsRef,
  selectBtn,
  openBtn,
  closeBtn,
  connectBtn,
  openICCartBtn,
  closeICCartBtn,
  initICCartBtn
} = useSerial();
</script>

<template>
  <el-card shadow="never">
    <el-space wrap>
      <el-button @click="selectBtn"> 选择串口 </el-button>
      <el-button @click="openBtn"> 打开串口 </el-button>
      <el-button @click="connectBtn"> 连接设备 </el-button>
      <el-button @click="openICCartBtn"> 打开IC卡 </el-button>
      <el-button @click="initICCartBtn"> 初始化IC卡 </el-button>
      <el-button @click="closeICCartBtn"> 关闭IC卡 </el-button>
      <el-button @click="closeBtn"> 关闭串口 </el-button>
    </el-space>
    <el-space wrap>
      <el-input
        type="textarea"
        v-model="serialLogsRef"
        rows="20"
        :style="{ width: '700px' }"
      />
    </el-space>
  </el-card>
</template>
